'use strict';
angular.module('app').directive('appCategory', [() => {
  return {
    restrict: 'AE',
    replace: true,
    scope: {
      company: '='
    },
    templateUrl: 'view/template/positionClass.html',
    link: function ($scope) {
      $scope.showPositionList = function (idx) {
        $scope.positionList = $scope.company.positionClass[idx].positionList;
        $scope.isActive = idx;
      }
      $scope.$watch('company', function (newVal) {
        if (newVal) {
          $scope.showPositionList(0);
        }
      });
    }
  }
}])
